package com.learncloud.user.feign.fallback;

import com.learncloud.user.feign.RemoteUserService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
  * @description TODO
  * @author lbx
  * @date 2021/10/26 9:57
  * @version 1.0.0
 **/
@Slf4j
@Component
public class UserServiceFallBackFactory implements FallbackFactory<RemoteUserService> {
    @Override
    public RemoteUserService create(Throwable throwable) {
        return new RemoteUserService() {
            @Override
            public String get() {
                log.error("调用失败。。。。。。。。。");
                return "ERROR";
            }
        };
    }
}
